import akshare as ak
import sys
# 板块行情
#	indicator=”新浪行业”; choice of {“新浪行业”, “启明星行业”, “概念”, “地域”, “行业”}

# 名称	类型	默认显示	描述
# label	str	Y	–
# 板块	str	Y	–
# 公司家数	float	Y	–
# 平均价格	float	Y	–
# 涨跌额	float	Y	–
# 涨跌幅	float	Y	注意单位: %
# 总成交量(手)	float	Y	–
# 总成交额(万元)	float	Y	–
# 股票代码	str	Y	–
# 涨跌幅	float	Y	注意单位: %
# 当前价	float	Y	–
# 涨跌额	float	Y	–
# 股票名称	str	Y	–

def stock_sector_spot(code):
    stock_sector_spot = ak.stock_sector_spot(indicator=code)
    for indexs in stock_sector_spot.index:
        s = ''
        index = stock_sector_spot.loc[indexs]
        for i in range(index.size):
            s = s + str(index[i])
            if i != index.size - 1:
                s = s + ","
        print(s)



if __name__ == '__main__':
    for i in range(1, len(sys.argv)):
        url = sys.argv[i]
        stock_sector_spot(url)